<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/metinfo.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/cookie.js"></script>

<link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
<link rel="stylesheet" href="__PUBLIC__/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="__PUBLIC__/css/colorpicker.css" />
<link rel="stylesheet" href="__PUBLIC__/css/datepicker.css" />
<link rel="stylesheet" href="__PUBLIC__/css/uniform.css" />
<link rel="stylesheet" href="__PUBLIC__/css/select2.css" />
<link rel="stylesheet" href="__PUBLIC__/css/matrix-style.css" />
<link rel="stylesheet" href="__PUBLIC__/css/bootstrap-wysihtml5.css" />

<script type="text/javascript">
var bnt_txt1 = "获取Meta信息";
var bnt_txt2 = "网站已经存在";
$(function() {
	$('#getmeta').bind('click', function() {
		var weburl = $('#weburl').val();
		$.post('{:U("Site/ajaxCheck")}', {
			action : "metainfo",
			weburl : weburl
		}, function(data) {
			if (data.status == 1) {
				$('#weburl').addClass('pass');
				$('#pages').val(data.data.pages);
				$('#unlinks').val(data.data.unlinks);
				$('#snapshot').val(data.data.snapshot);
				$('#webmetatitle').val(data.data.title);
				$('#webmetakeys').val(data.data.keywords);
				$('#webmetadesc').val(data.data.description);
			} else {
				$('#weburl').addClass('error');
				alert(data.info);
			}
		})
	})
})

function checkUrl(obj) {
	var weburl = obj.value;
	if (weburl.length > 0) {
		$.post('{:U("Site/ajaxCheck")}', {
			action : "checkurl",
			weburl : weburl
		}, function(data) {
			if (data) {
				$(obj).addClass('pass');
			} else {
				$('#getmeta').unbind('click');
				$(obj).addClass('error');
				$(obj).focus();
			}
		})
	} else {
		$(obj).addClass('error');
		$(obj).focus();
	}
}
</script>
</head>
<body class="wysihtml5-supported">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom">网站后台</a><a class="tip-bottom" href="{:U('Index/lists')}">网站管理</a><a class="current">添加网站</a>
		</div>
	</div>
	<div class="clear"></div>
		<form action="{$url}" method="post" class="form-horizontal">
            <div class="control-group">
              <label class="control-label">网站地址：</label>
              <div class="controls">
                <input type="text" class="span3" placeholder="http://" id="weburl" name="webinfo[weburl]" value="" />&nbsp;&nbsp;<input id="getmeta" type="button" class="btn btn-info" value="查询Meta信息">
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">网站名称：</label>
              <div class="controls">
                <input type="text" class="span4" placeholder="网站名称" id="webname"	name="webinfo[webname]"/>
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站标题：</label>
              <div class="controls">
                <textarea class="span11" id="webmetatitle" cols="40" name="webinfo[webmetatitle]"></textarea>
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站关键字：</label>
              <div class="controls">
                <textarea class="span11" name="webinfo[webmetakeys]" cols="40" id="webmetakeys"></textarea>
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站描述：</label>
              <div class="controls">
                <textarea class="span11" name="webinfo[webmetadesc]" cols="40" id="webmetadesc"></textarea>
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">搜索引擎：</label>
			  <div class="controls">
                <label class="span1"><input type="radio" name="radios" />百度</label>
                <label class="span1"><input type="radio" name="radios" />谷歌</label>
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站收录：</label>
              <div class="controls">
                <input type="text" class="span4" placeholder="" id="pages" name="cominfo[pages]"  />
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站反链：</label>
              <div class="controls">
                <input type="text" class="span4" placeholder="" id="unlinks" name="cominfo[unlinks]" />
              </div>
            </div>
			<div class="control-group">
              <label class="control-label">网站快照：</label>
              <div class="controls">
                <input type="text" class="span4" placeholder="" id="snapshot" name="cominfo[snapshot]" />
              </div>
            </div>
            <div class="form-actions center">
              <input type="submit" class="btn btn-success" value="保&nbsp;&nbsp;存" />&nbsp;&nbsp;
			  <input class="btn btn-danger" type="reset" value="取&nbsp;&nbsp;消" />
            </div>
          </form>
		    <script src="__PUBLIC__/js/jquery.ui.custom.js"></script> 
			<script src="__PUBLIC__/js/bootstrap.min.js"></script> 
			<script src="__PUBLIC__/js/bootstrap-colorpicker.js"></script> 
			<script src="__PUBLIC__/js/bootstrap-datepicker.js"></script> 
			<script src="__PUBLIC__/js/jquery.toggle.buttons.html"></script> 
			<script src="__PUBLIC__/js/masked.js"></script> 
			<script src="__PUBLIC__/js/jquery.uniform.js"></script> 
			<script src="__PUBLIC__/js/select2.min.js"></script> 
			<script src="__PUBLIC__/js/matrix.js"></script> 
			<script src="__PUBLIC__/js/matrix.form_common.js"></script> 
			<script src="__PUBLIC__/js/wysihtml5-0.3.0.js"></script> 
			<script src="__PUBLIC__/js/jquery.peity.min.js"></script> 
			<script src="__PUBLIC__/js/bootstrap-wysihtml5.js"></script> 
	</body>
</html>
